package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ContractExpireMapper;
import com.ruoyi.system.domain.ContractExpire;
import com.ruoyi.system.service.IContractExpireService;

/**
 * 到期通知Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-26
 */
@Service
public class ContractExpireServiceImpl implements IContractExpireService
{
    @Autowired
    private ContractExpireMapper contractExpireMapper;

    /**
     * 查询到期通知
     *
     * @param id 到期通知主键
     * @return 到期通知
     */
    @Override
    public ContractExpire selectContractExpireById(Long id)
    {
        return contractExpireMapper.selectContractExpireById(id);
    }

    @Override
    public ContractExpire selectContractExpireByPlanId(Long planId)
    {
        return contractExpireMapper.selectContractExpireByPlanId(planId);
    }

    /**
     * 查询到期通知列表
     *
     * @param contractExpire 到期通知
     * @return 到期通知
     */
    @Override
    public List<ContractExpire> selectContractExpireList(ContractExpire contractExpire)
    {
        return contractExpireMapper.selectContractExpireList(contractExpire);
    }

    /**
     * 新增到期通知
     *
     * @param contractExpire 到期通知
     * @return 结果
     */
    @Override
    public int insertContractExpire(ContractExpire contractExpire)
    {
        contractExpire.setCreateTime(DateUtils.getNowDate());
        return contractExpireMapper.insertContractExpire(contractExpire);
    }

    /**
     * 修改到期通知
     *
     * @param contractExpire 到期通知
     * @return 结果
     */
    @Override
    public int updateContractExpire(ContractExpire contractExpire)
    {
        contractExpire.setUpdateTime(DateUtils.getNowDate());
        return contractExpireMapper.updateContractExpire(contractExpire);
    }

    /**
     * 批量删除到期通知
     *
     * @param ids 需要删除的到期通知主键
     * @return 结果
     */
    @Override
    public int deleteContractExpireByIds(Long[] ids)
    {
        return contractExpireMapper.deleteContractExpireByIds(ids);
    }

    /**
     * 删除到期通知信息
     *
     * @param id 到期通知主键
     * @return 结果
     */
    @Override
    public int deleteContractExpireById(Long id)
    {
        return contractExpireMapper.deleteContractExpireById(id);
    }
    @Override
    public int deleteContractExpireAll()
    {
        return contractExpireMapper.deleteContractExpireAll();
    }
}
